<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>Kyoto Cabinet: kyotocabinet::CondMap Class Reference</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />



</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">Kyoto Cabinet
   
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.6.1 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
  <div id="nav-path" class="navpath">
    <ul>
      <li class="navelem"><a class="el" href="namespacekyotocabinet.html">kyotocabinet</a>      </li>
      <li class="navelem"><a class="el" href="classkyotocabinet_1_1CondMap.html">CondMap</a>      </li>
    </ul>
  </div>
</div>
<div class="header">
  <div class="summary">
<a href="#nested-classes">Classes</a> &#124;
<a href="#pub-methods">Public Member Functions</a>  </div>
  <div class="headertitle">
<div class="title">kyotocabinet::CondMap Class Reference</div>  </div>
</div><!--header-->
<div class="contents">
<!-- doxytag: class="kyotocabinet::CondMap" -->
<p>Assosiative condition variable.  
 <a href="classkyotocabinet_1_1CondMap.html#details">More...</a></p>

<p><code>#include &lt;kcthread.h&gt;</code></p>

<p><a href="classkyotocabinet_1_1CondMap-members.html">List of all members.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="nested-classes"></a>
Classes</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><b>Count</b></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Counter for waiting threads. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><b>Slot</b></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Slot of a key space. <br/></td></tr>
<tr><td colspan="2"><h2><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classkyotocabinet_1_1CondMap.html#a72a7e6edb766edcec377a36dd2ce047d">CondMap</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Default constructor.  <a href="#a72a7e6edb766edcec377a36dd2ce047d"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classkyotocabinet_1_1CondMap.html#a7d8f3082e0ec7e4eb8533ba07bb532f4">~CondMap</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Destructor.  <a href="#a7d8f3082e0ec7e4eb8533ba07bb532f4"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classkyotocabinet_1_1CondMap.html#ae608224a6bcb372ec3d365016808cdf4">wait</a> (const char *kbuf, size_t ksiz, double sec=-1)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Wait for a signal.  <a href="#ae608224a6bcb372ec3d365016808cdf4"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classkyotocabinet_1_1CondMap.html#adb67f06cb182a5aec081cd2e9dcc17ac">wait</a> (const std::string &amp;key, double sec=-1)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Wait for a signal by a key.  <a href="#adb67f06cb182a5aec081cd2e9dcc17ac"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classkyotocabinet_1_1CondMap.html#afe15a0ab8558dc4d2c44e43a89d928cd">signal</a> (const char *kbuf, size_t ksiz)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Send a wake-up signal to another thread waiting by a key.  <a href="#afe15a0ab8558dc4d2c44e43a89d928cd"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classkyotocabinet_1_1CondMap.html#a7df30a66b37d4ed12c8b553128e79893">signal</a> (const std::string &amp;key)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Send a wake-up signal to another thread waiting by a key.  <a href="#a7df30a66b37d4ed12c8b553128e79893"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classkyotocabinet_1_1CondMap.html#a6906005a4b1b2768e978562e9086d418">broadcast</a> (const char *kbuf, size_t ksiz)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Send wake-up signals to all threads waiting by a key.  <a href="#a6906005a4b1b2768e978562e9086d418"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classkyotocabinet_1_1CondMap.html#acc9c4d05a5a4da2bb000b076bad29ece">broadcast</a> (const std::string &amp;key)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Send wake-up signals to all threads waiting by a key.  <a href="#acc9c4d05a5a4da2bb000b076bad29ece"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classkyotocabinet_1_1CondMap.html#ac86c83297c59700b115bf06bc33eb5cf">broadcast_all</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Send wake-up signals to all threads waiting by each key.  <a href="#ac86c83297c59700b115bf06bc33eb5cf"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classkyotocabinet_1_1CondMap.html#aa8feeb8374151a569f23892e994390dd">count</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the total number of threads waiting for signals.  <a href="#aa8feeb8374151a569f23892e994390dd"></a><br/></td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"><p>Assosiative condition variable. </p>
</div><hr/><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="a72a7e6edb766edcec377a36dd2ce047d"></a><!-- doxytag: member="kyotocabinet::CondMap::CondMap" ref="a72a7e6edb766edcec377a36dd2ce047d" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classkyotocabinet_1_1CondMap.html#a72a7e6edb766edcec377a36dd2ce047d">kyotocabinet::CondMap::CondMap</a> </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td><code> [explicit]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Default constructor. </p>

</div>
</div>
<a class="anchor" id="a7d8f3082e0ec7e4eb8533ba07bb532f4"></a><!-- doxytag: member="kyotocabinet::CondMap::~CondMap" ref="a7d8f3082e0ec7e4eb8533ba07bb532f4" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classkyotocabinet_1_1CondMap.html#a7d8f3082e0ec7e4eb8533ba07bb532f4">kyotocabinet::CondMap::~CondMap</a> </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Destructor. </p>

</div>
</div>
<hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="ae608224a6bcb372ec3d365016808cdf4"></a><!-- doxytag: member="kyotocabinet::CondMap::wait" ref="ae608224a6bcb372ec3d365016808cdf4" args="(const char *kbuf, size_t ksiz, double sec=&#45;1)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool <a class="el" href="classkyotocabinet_1_1CondMap.html#ae608224a6bcb372ec3d365016808cdf4">kyotocabinet::CondMap::wait</a> </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>kbuf</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>ksiz</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double&#160;</td>
          <td class="paramname"><em>sec</em> = <code>-1</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Wait for a signal. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">kbuf</td><td>the pointer to the key region. </td></tr>
    <tr><td class="paramname">ksiz</td><td>the size of the key region. </td></tr>
    <tr><td class="paramname">sec</td><td>the interval of the suspension in seconds. If it is negative, no timeout is specified. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>true on catched signal, or false on timeout. </dd></dl>

</div>
</div>
<a class="anchor" id="adb67f06cb182a5aec081cd2e9dcc17ac"></a><!-- doxytag: member="kyotocabinet::CondMap::wait" ref="adb67f06cb182a5aec081cd2e9dcc17ac" args="(const std::string &amp;key, double sec=&#45;1)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool <a class="el" href="classkyotocabinet_1_1CondMap.html#ae608224a6bcb372ec3d365016808cdf4">kyotocabinet::CondMap::wait</a> </td>
          <td>(</td>
          <td class="paramtype">const std::string &amp;&#160;</td>
          <td class="paramname"><em>key</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double&#160;</td>
          <td class="paramname"><em>sec</em> = <code>-1</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Wait for a signal by a key. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">key</td><td>the key. </td></tr>
    <tr><td class="paramname">sec</td><td>the interval of the suspension in seconds. If it is negative, no timeout is specified. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>true on catched signal, or false on timeout. </dd></dl>

</div>
</div>
<a class="anchor" id="afe15a0ab8558dc4d2c44e43a89d928cd"></a><!-- doxytag: member="kyotocabinet::CondMap::signal" ref="afe15a0ab8558dc4d2c44e43a89d928cd" args="(const char *kbuf, size_t ksiz)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">size_t <a class="el" href="classkyotocabinet_1_1CondMap.html#afe15a0ab8558dc4d2c44e43a89d928cd">kyotocabinet::CondMap::signal</a> </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>kbuf</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>ksiz</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Send a wake-up signal to another thread waiting by a key. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">kbuf</td><td>the pointer to the key region. </td></tr>
    <tr><td class="paramname">ksiz</td><td>the size of the key region. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>the number of threads waiting for the signal. </dd></dl>

</div>
</div>
<a class="anchor" id="a7df30a66b37d4ed12c8b553128e79893"></a><!-- doxytag: member="kyotocabinet::CondMap::signal" ref="a7df30a66b37d4ed12c8b553128e79893" args="(const std::string &amp;key)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">size_t <a class="el" href="classkyotocabinet_1_1CondMap.html#afe15a0ab8558dc4d2c44e43a89d928cd">kyotocabinet::CondMap::signal</a> </td>
          <td>(</td>
          <td class="paramtype">const std::string &amp;&#160;</td>
          <td class="paramname"><em>key</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Send a wake-up signal to another thread waiting by a key. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">key</td><td>the key. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>the number of threads waiting for the signal. </dd></dl>

</div>
</div>
<a class="anchor" id="a6906005a4b1b2768e978562e9086d418"></a><!-- doxytag: member="kyotocabinet::CondMap::broadcast" ref="a6906005a4b1b2768e978562e9086d418" args="(const char *kbuf, size_t ksiz)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">size_t <a class="el" href="classkyotocabinet_1_1CondMap.html#a6906005a4b1b2768e978562e9086d418">kyotocabinet::CondMap::broadcast</a> </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>kbuf</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>ksiz</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Send wake-up signals to all threads waiting by a key. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">kbuf</td><td>the pointer to the key region. </td></tr>
    <tr><td class="paramname">ksiz</td><td>the size of the key region. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>the number of threads waiting for the signal. </dd></dl>

</div>
</div>
<a class="anchor" id="acc9c4d05a5a4da2bb000b076bad29ece"></a><!-- doxytag: member="kyotocabinet::CondMap::broadcast" ref="acc9c4d05a5a4da2bb000b076bad29ece" args="(const std::string &amp;key)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">size_t <a class="el" href="classkyotocabinet_1_1CondMap.html#a6906005a4b1b2768e978562e9086d418">kyotocabinet::CondMap::broadcast</a> </td>
          <td>(</td>
          <td class="paramtype">const std::string &amp;&#160;</td>
          <td class="paramname"><em>key</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Send wake-up signals to all threads waiting by a key. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">key</td><td>the key. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>the number of threads waiting for the signal. </dd></dl>

</div>
</div>
<a class="anchor" id="ac86c83297c59700b115bf06bc33eb5cf"></a><!-- doxytag: member="kyotocabinet::CondMap::broadcast_all" ref="ac86c83297c59700b115bf06bc33eb5cf" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">size_t <a class="el" href="classkyotocabinet_1_1CondMap.html#ac86c83297c59700b115bf06bc33eb5cf">kyotocabinet::CondMap::broadcast_all</a> </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Send wake-up signals to all threads waiting by each key. </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>the number of threads waiting for the signal. </dd></dl>

</div>
</div>
<a class="anchor" id="aa8feeb8374151a569f23892e994390dd"></a><!-- doxytag: member="kyotocabinet::CondMap::count" ref="aa8feeb8374151a569f23892e994390dd" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">size_t <a class="el" href="classkyotocabinet_1_1CondMap.html#aa8feeb8374151a569f23892e994390dd">kyotocabinet::CondMap::count</a> </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Get the total number of threads waiting for signals. </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>the total number of threads waiting for signals. </dd></dl>

</div>
</div>
</div><!-- contents -->


<hr class="footer"/><address class="footer"><small>
Generated on Fri May 25 2012 01:21:36 for Kyoto Cabinet by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.7.6.1
</small></address>

</body>
</html>
